package cn.etynit.mms.fallback;

import cn.etynit.domain.ExpenseNaturalGas;
import cn.etynit.dto.RechargeDto;
import cn.etynit.exception.GlobalExceptionCodeEnum;
import cn.etynit.mms.feign.ExpenseNaturalGasService;
import cn.etynit.result.JsonResult;
import cn.etynit.vo.RechargeVo;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ExpenseNaturalGasServiceFallbackFactory implements FallbackFactory<ExpenseNaturalGasService> {
    @Override
    public ExpenseNaturalGasService create(Throwable throwable) {
        return new ExpenseNaturalGasService() {
            @Override
            public JsonResult saveOrUpdate(ExpenseNaturalGas expenseNaturalGas) {
                return JsonResult.error(GlobalExceptionCodeEnum.ERROR);
            }

            @Override
            public JsonResult recharge(RechargeVo rechargeVo) {
                return JsonResult.error(GlobalExceptionCodeEnum.ERROR);
            }

            @Override
            public JsonResult selectByUserId(Long userId) {
                return JsonResult.error(GlobalExceptionCodeEnum.ERROR);
            }
        };
    }
}
